Dmitry Shachnev [Sun, 14 Nov 2021 18:08:50 +0000 (21:08 +0300)]
Find the build directory matching the current interpreter
This is needed to allow us to run tests with all supported Python versions.
Without this patch, the latest build directory will be always picked, no
matter what the current interpreter is.
Christian Tismer [Fri, 20 Aug 2021 16:18:57 +0000 (18:18 +0200)]
py3.10-prep: Fix a very old refcounting error in time_test.py
Since 2012-03-08, there was a refcounting error in
the typesystem_sample.xml file at <value-type name="Time">.
The boolean function results were not refcounted.
This bug was hard to find because nobody expects a failure in the
testing code, and the error shows up at the very end in the
finalization code, totally unrelated to the error location.
In order to find it, the setting `PYTHONMALLOC=malloc` was needed,
because otherwise we got a Python memory dump but no traceback.
Then, Python was modified and code was inserted in the various
involved `code_dealloc`, `tupledealloc` and `object_dealloc`
functions that printed the involved refcounts and types before
performing the actual deallocation.
This bug actually was of no harm since only the wrong test was
involved. It was very misleading because there were quite some
changes to the `datetime` module in Python 3.10. But the bug
was nothing but a dormant refcounting error.
After the major problems are solved in
py3.10-prep: re-implement zip import
py3.10-prep: reset the type cache after feature switching
py3.10-prep: Fix parser.py for changed typing module
, there are only some minor changes left to do. One thing
is still not clear:
* Unsolved: In time_test.py, the last two tests work but
crash at shutdown.
It is not yet clear if this is a PySide or Python error.
This will crash Python 3.10 if not solved until the release.
py3.10-prep: Fix parser.py for changed typing module
The typing module has subtle changes that are not even
documented: Typing types now have a __name__ attribute.
That confused the parser of the pyi generator because
suddenly stingizing
Callable[..., Optional[str]]
resulted in
Callable[..., Optional]
because of special rules that return the generic name
of a typing type, which was very unexpected. Finding this bug
took a lot of debugging of the recursive `_resolve_type`
function.
py3.10-prep: reset the type cache after feature switching
When using feature switching in Python 3.10, there were
funny effects where switched and un-switched versions appeared
to co-exist.
It turned out that we were hit by function caching that
is now implemented for the LOAD_ATTR opcode.
It was not known that caching would happen at all for
PySide classes because we don't use Py_TPFLAGS_VALID_VERSION_TAG.
But actually, this flag is used internally by Python to do some
optimizations, and we just have to notify the interpreter of
type changes by PyType_Modified().
Christian Tismer [Wed, 23 Dec 2020 11:28:16 +0000 (13:28 +0200)]
qApp: fix flag handling in Python 3.8+ and a Python 3.9 issue
This is an old problem that was solved for Python 2.7.
From Python 3.8 on, the behavior is the same with Python 3.
The fix finally was to extend a Python 2.7 patch to Python 3
as well. See the Jira issue for details.
This patch includes also a small patch that was mentioned as
necessary for Python 3.9: Python issue 40217. I have seen no
effect of this change yet but applied the patch, anyway.
Dmitry Shachnev [Wed, 16 Dec 2020 17:26:18 +0000 (20:26 +0300)]
Pass --reuse-build only to commands that use DistUtilsCommandMixin
This is a concatenation of two upstream commits:
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=ed0571df854a232e
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=3f00c2adad2e38b0
Dmitry Shachnev [Sun, 14 Nov 2021 18:08:50 +0000 (21:08 +0300)]
Find the build directory matching the current interpreter
This is needed to allow us to run tests with all supported Python versions.
Without this patch, the latest build directory will be always picked, no
matter what the current interpreter is.
Christian Tismer [Fri, 20 Aug 2021 16:18:57 +0000 (18:18 +0200)]
py3.10-prep: Fix a very old refcounting error in time_test.py
Since 2012-03-08, there was a refcounting error in
the typesystem_sample.xml file at <value-type name="Time">.
The boolean function results were not refcounted.
This bug was hard to find because nobody expects a failure in the
testing code, and the error shows up at the very end in the
finalization code, totally unrelated to the error location.
In order to find it, the setting `PYTHONMALLOC=malloc` was needed,
because otherwise we got a Python memory dump but no traceback.
Then, Python was modified and code was inserted in the various
involved `code_dealloc`, `tupledealloc` and `object_dealloc`
functions that printed the involved refcounts and types before
performing the actual deallocation.
This bug actually was of no harm since only the wrong test was
involved. It was very misleading because there were quite some
changes to the `datetime` module in Python 3.10. But the bug
was nothing but a dormant refcounting error.
After the major problems are solved in
py3.10-prep: re-implement zip import
py3.10-prep: reset the type cache after feature switching
py3.10-prep: Fix parser.py for changed typing module
, there are only some minor changes left to do. One thing
is still not clear:
* Unsolved: In time_test.py, the last two tests work but
crash at shutdown.
It is not yet clear if this is a PySide or Python error.
This will crash Python 3.10 if not solved until the release.
py3.10-prep: Fix parser.py for changed typing module
The typing module has subtle changes that are not even
documented: Typing types now have a __name__ attribute.
That confused the parser of the pyi generator because
suddenly stingizing
Callable[..., Optional[str]]
resulted in
Callable[..., Optional]
because of special rules that return the generic name
of a typing type, which was very unexpected. Finding this bug
took a lot of debugging of the recursive `_resolve_type`
function.
py3.10-prep: reset the type cache after feature switching
When using feature switching in Python 3.10, there were
funny effects where switched and un-switched versions appeared
to co-exist.
It turned out that we were hit by function caching that
is now implemented for the LOAD_ATTR opcode.
It was not known that caching would happen at all for
PySide classes because we don't use Py_TPFLAGS_VALID_VERSION_TAG.
But actually, this flag is used internally by Python to do some
optimizations, and we just have to notify the interpreter of
type changes by PyType_Modified().
Christian Tismer [Wed, 23 Dec 2020 11:28:16 +0000 (13:28 +0200)]
qApp: fix flag handling in Python 3.8+ and a Python 3.9 issue
This is an old problem that was solved for Python 2.7.
From Python 3.8 on, the behavior is the same with Python 3.
The fix finally was to extend a Python 2.7 patch to Python 3
as well. See the Jira issue for details.
This patch includes also a small patch that was mentioned as
necessary for Python 3.9: Python issue 40217. I have seen no
effect of this change yet but applied the patch, anyway.
Dmitry Shachnev [Wed, 16 Dec 2020 17:26:18 +0000 (20:26 +0300)]
Pass --reuse-build only to commands that use DistUtilsCommandMixin
This is a concatenation of two upstream commits:
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=ed0571df854a232e
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=3f00c2adad2e38b0
Dmitry Shachnev [Sun, 14 Nov 2021 18:08:50 +0000 (21:08 +0300)]
Find the build directory matching the current interpreter
This is needed to allow us to run tests with all supported Python versions.
Without this patch, the latest build directory will be always picked, no
matter what the current interpreter is.
Christian Tismer [Fri, 20 Aug 2021 16:18:57 +0000 (18:18 +0200)]
py3.10-prep: Fix a very old refcounting error in time_test.py
Since 2012-03-08, there was a refcounting error in
the typesystem_sample.xml file at <value-type name="Time">.
The boolean function results were not refcounted.
This bug was hard to find because nobody expects a failure in the
testing code, and the error shows up at the very end in the
finalization code, totally unrelated to the error location.
In order to find it, the setting `PYTHONMALLOC=malloc` was needed,
because otherwise we got a Python memory dump but no traceback.
Then, Python was modified and code was inserted in the various
involved `code_dealloc`, `tupledealloc` and `object_dealloc`
functions that printed the involved refcounts and types before
performing the actual deallocation.
This bug actually was of no harm since only the wrong test was
involved. It was very misleading because there were quite some
changes to the `datetime` module in Python 3.10. But the bug
was nothing but a dormant refcounting error.
After the major problems are solved in
py3.10-prep: re-implement zip import
py3.10-prep: reset the type cache after feature switching
py3.10-prep: Fix parser.py for changed typing module
, there are only some minor changes left to do. One thing
is still not clear:
* Unsolved: In time_test.py, the last two tests work but
crash at shutdown.
It is not yet clear if this is a PySide or Python error.
This will crash Python 3.10 if not solved until the release.
py3.10-prep: Fix parser.py for changed typing module
The typing module has subtle changes that are not even
documented: Typing types now have a __name__ attribute.
That confused the parser of the pyi generator because
suddenly stingizing
Callable[..., Optional[str]]
resulted in
Callable[..., Optional]
because of special rules that return the generic name
of a typing type, which was very unexpected. Finding this bug
took a lot of debugging of the recursive `_resolve_type`
function.
py3.10-prep: reset the type cache after feature switching
When using feature switching in Python 3.10, there were
funny effects where switched and un-switched versions appeared
to co-exist.
It turned out that we were hit by function caching that
is now implemented for the LOAD_ATTR opcode.
It was not known that caching would happen at all for
PySide classes because we don't use Py_TPFLAGS_VALID_VERSION_TAG.
But actually, this flag is used internally by Python to do some
optimizations, and we just have to notify the interpreter of
type changes by PyType_Modified().
Christian Tismer [Wed, 23 Dec 2020 11:28:16 +0000 (13:28 +0200)]
qApp: fix flag handling in Python 3.8+ and a Python 3.9 issue
This is an old problem that was solved for Python 2.7.
From Python 3.8 on, the behavior is the same with Python 3.
The fix finally was to extend a Python 2.7 patch to Python 3
as well. See the Jira issue for details.
This patch includes also a small patch that was mentioned as
necessary for Python 3.9: Python issue 40217. I have seen no
effect of this change yet but applied the patch, anyway.
Dmitry Shachnev [Wed, 16 Dec 2020 17:26:18 +0000 (20:26 +0300)]
Pass --reuse-build only to commands that use DistUtilsCommandMixin
This is a concatenation of two upstream commits:
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=ed0571df854a232e
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=3f00c2adad2e38b0
Dmitry Shachnev [Tue, 16 Nov 2021 09:16:14 +0000 (09:16 +0000)]
pyside2 (5.15.2-2) unstable; urgency=medium
* Backport upstream patches for Python 3.10 support (closes: #999369).
* Backport upstream patch to adapt for LLVM 12.01.
* Run build-time tests with all supported Python versions.
- Add a patch to make the tests find the matching build directory.
Christian Tismer [Wed, 23 Dec 2020 11:28:16 +0000 (13:28 +0200)]
qApp: fix flag handling in Python 3.8+ and a Python 3.9 issue
This is an old problem that was solved for Python 2.7.
From Python 3.8 on, the behavior is the same with Python 3.
The fix finally was to extend a Python 2.7 patch to Python 3
as well. See the Jira issue for details.
This patch includes also a small patch that was mentioned as
necessary for Python 3.9: Python issue 40217. I have seen no
effect of this change yet but applied the patch, anyway.
Dmitry Shachnev [Wed, 16 Dec 2020 17:26:18 +0000 (20:26 +0300)]
Pass --reuse-build only to commands that use DistUtilsCommandMixin
This is a concatenation of two upstream commits:
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=ed0571df854a232e
- https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=3f00c2adad2e38b0
Dmitry Shachnev [Sat, 26 Dec 2020 08:39:45 +0000 (08:39 +0000)]
pyside2 (5.15.2-1) unstable; urgency=medium
* Team upload.
* Add missing dependencies to make the autopkgtest pass again.
* Backport proposed upstream patch to fix qApp flags handling.
- Unblacklist QtWidgets::bug_307 test, it should not fail anymore.
Also update patchelf's build process to match the logic in upstream's
automake files (thanks to Frédéric Bonnard for the patch to properly use
getconf PAGESIZE).
[ Dmitry Shachnev ]
* Drop ftbfs-old-qt.patch. Not needed since Debian has Qt 5.15.
* Stop hardcoding py3.8 in debian/shiboken2-doc.docs (closes: #976900).
* Blacklist QtWidgets::bug_307 test for now (closes: #976516).
Also update patchelf's build process to match the logic in upstream's
automake files (thanks to Frédéric Bonnard for the patch to properly use
getconf PAGESIZE).
Also update patchelf's build process to match the logic in upstream's
automake files (thanks to Frédéric Bonnard for the patch to properly use
getconf PAGESIZE).
Kurt Kremitzki [Sun, 5 Jul 2020 10:13:51 +0000 (11:13 +0100)]
pyside2 (5.15.0-3) unstable; urgency=medium
[ Dmitry Shachnev ]
* Bump Qt build-dependencies to 5.14. As most Qt packages have a
Build-Depends-Package field in their symbols files, dpkg-shlibdeps will
use that information and generate a runtime dependency on a new enough
Qt version (closes: #963983).
[ Kurt Kremitzki ]
* Remove Freexian folks and add myself to Uploaders
* Correct libshiboken2 CMake include path (Closes: #964201)
Also update patchelf's build process to match the logic in upstream's
automake files (thanks to Frédéric Bonnard for the patch to properly use
getconf PAGESIZE).
[PATCH 2/3] Optimize the Python 3.8 refcount fix a tiny bit
This change uses the fact that our workaround to temporarily remove
the Py_TPFLAGS_METHOD_DESCRIPTOR flag uses the "mro" function
of PyType_Type, which never will change.
Therefore, the static keyword makes sure that this function lookup
happens only once.
Change-Id: I44b74556da1fac2596c81339af30cb66218276e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Gbp-Pq: Name 0003-Optimize-the-Python-3.8-refcount-fix-a-tiny-bit.patch
Christian Tismer [Tue, 26 Nov 2019 10:54:37 +0000 (11:54 +0100)]
[PATCH 1/3] Fix Python 3.8 problems
This patch fixes some refcounting problems with Python 3.8 .
One incompatible change was announced in the what's new
document, but actually there were two more problems which
were not explicitly mentioned but took much time to sort out.
The patch is compatible with the limited API changes
(tested with debug build and API error disabled).
It is also independent of the Python version which is
full Limited API support.
For more info, see the documentation mentioned below.
The flag error is circumvented now! We either find a better
solution or leave it as it is. For now this is ok.
Fixes: PYSIDE-939
Change-Id: Iff4a9816857a6ebe86efd4b654d8921e4e464939 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Gbp-Pq: Name 0002-Fix-Python-3.8-problems.patch
Also update patchelf's build process to match the logic in upstream's
automake files (thanks to Frédéric Bonnard for the patch to properly use
getconf PAGESIZE).